package org.stvd.service.admin.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.stvd.core.dto.QueryResult;
import org.stvd.entities.admin.Resources;
import org.stvd.repository.admin.ResourcesDao;
import org.stvd.repository.admin.RolesDao;
import org.stvd.service.admin.ResourcesService;
import org.stvd.service.base.impl.BaseServiceImpl;

/**
 * @Title: ResourcesServiceImpl
 * @Description: 系统资源业务层接口实现类
 * @author houzx
 * @date 2020年8月8日
 */
@Service("resourcesService")
public class ResourcesServiceImpl extends BaseServiceImpl<Resources> implements ResourcesService {

    @Resource(name = "ResourcesDao")
    private ResourcesDao resourcesDao;

    @Resource(name = "RolesDao")
    private RolesDao rolesDao;

    @Override
    public List<Resources> findResourceAll(String guid) {
        return resourcesDao.findResourceAll(guid);
    }

    @Override
    public List<Resources> findResourcesByRoleId(String roleId, String guid) {
        return resourcesDao.findResourcesByRoleId(roleId, guid);
    }

    @Override
    public List<Resources> findResourcesByUid(String userId, String guid) {
        return resourcesDao.findResourcesByUid(userId, guid);
    }
    
    @Override
    public List<Resources> findResourcesByType(String type, String guid) {
        return resourcesDao.findResourcesByType(type, guid);
    }
    
    @Override
    public QueryResult<Resources> getResourceQueryResult(int start, int limit, String type, String guid) {
        return resourcesDao.getResourceQueryResult(start, limit, type, guid);
    }
}
